package com.xk.demo.role.respository;

import com.xk.demo.mybatis.entity.PtRoleEntity;
import com.xk.demo.mybatis.flexigrid.PagingBean;
import com.xk.demo.mybatis.ztree.ZtreeEntity;
import com.xk.demo.role.entity.SearchRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleDao {
    List<PtRoleEntity> queryRoleListByPage(@Param("search") SearchRoleEntity search, @Param("paging") PagingBean paging);

    Integer queryRoleListTotal(@Param("search") SearchRoleEntity search);

    List<ZtreeEntity> getMenuZtreeList(@Param("lang") String lang);

    List<String> getMenuZtreeListByRoleId(@Param("roleUuid") String roleUuid);

    void deleteMenuByRole(@Param("roleUuid") String roleUuid);


    void insertMenuRefRole(@Param("roleUuid") String roleUuid,@Param("menuIds")  String[] menuIds);

    List<ZtreeEntity> queryMenuTree();


    void insertRole(@Param("ptRoleEntity") PtRoleEntity ptRoleEntity);
    void delRole(@Param("uuid") String uuid);
    int searchUserInRole(@Param("uuid") String uuid);
    int searchDutyByRole(@Param("uuid")String uuid);
    void delMenuByRole(@Param("uuid")String uuid);
}
